//
//  MineVC.m
//  leyitui
//
//  Created by 王大江 on 17/9/21.
//  Copyright © 2017年 xinleyi. All rights reserved.
//

#import "MineVC.h"
#import "PersonalDataVC.h"
#import "MainRewardVC.h"


@interface MineVC ()<UINavigationControllerDelegate>


@end

@implementation MineVC

- (void)viewDidLoad {
    [super viewDidLoad];
    self.navigationItem.title = @"乐易推";
    [self.navigationController.navigationBar setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor whiteColor]}];
//    [self setNavigationStyle];
    // 设置导航控制器的代理为self
    self.navigationController.delegate = self;
    //状态栏白色
    self.navigationController.navigationBar.barStyle = UIStatusBarStyleLightContent;
    
}

#pragma mark - UINavigationControllerDelegate
- (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated {
    // 判断要显示的控制器是否是自己
    BOOL isShowHomePage = [viewController isKindOfClass:[self class]];
    [self.navigationController setNavigationBarHidden:isShowHomePage animated:YES];
}

#pragma 设置导航栏样式 - 去背景、去底部线条、状态栏白色
- (void)setNavigationStyle {
    //去掉背景图片
    [self.navigationController.navigationBar setBackgroundImage:[[UIImage alloc] init] forBarMetrics:UIBarMetricsDefault];
    //去掉底部线条
    [self.navigationController.navigationBar setShadowImage:[[UIImage alloc] init]];
    self.navigationController.navigationBar.barStyle = UIStatusBarStyleLightContent;
}

- (IBAction)pensonalBtnClick:(id)sender {
    PersonalDataVC *personalDataVC = [[PersonalDataVC alloc] init];
    [self.navigationController pushViewController:personalDataVC animated:YES];
    
}

- (IBAction)myRewardBtnClick:(id)sender {
    MainRewardVC *mainRewardVC = [[MainRewardVC alloc] init];
    [self.navigationController pushViewController:mainRewardVC animated:YES];
    
}






@end
